<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2020/1/11
 * Time: 11:25
 */

namespace app\api\controller\v1;
use think\captcha\Captcha;
use think\Cookie;

class VerifyCode
{
    public function checkCode(){
        $code = input("code");
        $sign = Cookie::get('verify_sign');
        $captcha = new Captcha();
        if($captcha->check($code, $sign)){
            return ['code'=>200,'msg'=>'验证码输入正确!'];
        }else{
            return ['code'=>0,'msg'=>'验证码输入错误!'];
        }
    }
}